appid = ''  # 填写你的appid
secretKey = ''  # 填写你的密钥

trans_col_list = ['C', 'E', 'F', 'I', 'K', 'L', 'N', 'Q']  # 需要翻译的列

input_file = r'C:\Users\PC\Downloads\S01E19 Kernel Base 软件架构FMEA Software Architecture FMEA.xlsx'  # 待翻译文件
output_file = r'aaaa.xlsx'  # 翻译后输出的文件
target_sheet_key_word = r'FMEA'  # 工作簿中工作表的名称

# 百度翻译参见 https://fanyi-api.baidu.com/product/123#:~:text=error_msg%22%3A%20%22Invalid%20Sign%22%0A%7D-,%E8%AF%AD%E7%A7%8D%E5%88%97%E8%A1%A8,-%E6%BA%90%E8%AF%AD%E8%A8%80%E8%AF%AD
# 谷歌翻译参见 https://py-googletrans.readthedocs.io/en/latest/#:~:text=%3E%3E%3E%20tk%0A950629.577246-,googletrans.LANGUAGES,-Hint
from_lang = 'zh'  # 原始语言
to_lang = 'en'  # 目标语言

append_mode = True  # 追加模式 中英文模式(英文追加在中文之后)
# 不需要翻译的格子
skip_list = [
    '\\',
    '/',
    'NA',
]
# 不需要调用翻译API, 直接本地替换的格子
dictionary = {
    '无': 'None',
}


def check_value(value):
    assert value != '' and value is not None, 'Some configuration items are not configured, please check!'


def check_dict_value(my_dict: dict):
    list(map(check_value, my_dict.values()))


list(map(check_value, [appid, secretKey]))
